package com.rc.saas.mini.service.elec;

import com.rc.saas.mini.mapper.elec.ElecStationPriceMapper;
import com.rc.saas.mini.model.elec.ElecStationPrice;
import com.rc.saas.mini.search.ElecStationPriceSearch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wangzhengwei
 * @create 2021/12/18
 */
@Service
public class ElecStationPriceServiceImpl implements ElecStationPriceService {

    @Autowired
    private ElecStationPriceMapper elecStationPriceMapper;

    @Override
    public ElecStationPriceMapper getMapper() {
        return elecStationPriceMapper;
    }

    @Override
    public ElecStationPrice getCurrentPrice(ElecStationPriceSearch elecStationPriceSearch) {
        return elecStationPriceMapper.selectPriceByStationId(elecStationPriceSearch);
    }

    @Override
    public List<ElecStationPrice> listStationPricesByStationId(String tenantCode, String hlhtOperatorId, Long elecStationId) {
        ElecStationPriceSearch elecStationPriceSearch = new ElecStationPriceSearch();
        elecStationPriceSearch.setTenantCode(tenantCode);
        elecStationPriceSearch.setElecStationId(elecStationId);
        return elecStationPriceMapper.selectPricesByStationId(elecStationPriceSearch);
    }

    @Override
    public List<ElecStationPrice> listStationPriceByDate(List<Long> elecStationIds) {

        return elecStationPriceMapper.listStationPriceByDate(elecStationIds);
    }
}
